package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_order_refund", schema = "", catalog = "onedollar")
public class TOrderRefundEntity {
    private int id;
    private Integer userId;
    private Integer orderId;
    private Integer type;
    private String refundBank;
    private String refundAccount;
    private String refundPerson;
    private BigDecimal refundAmount;
    private String refundReason;
    private Timestamp addTime;
    private Timestamp updateTime;
    private Integer status;
    private String memo;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id", nullable = true, insertable = true, updatable = true)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "order_id", nullable = true, insertable = true, updatable = true)
    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    @Basic
    @Column(name = "type", nullable = true, insertable = true, updatable = true)
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Basic
    @Column(name = "refund_bank", nullable = true, insertable = true, updatable = true, length = 50)
    public String getRefundBank() {
        return refundBank;
    }

    public void setRefundBank(String refundBank) {
        this.refundBank = refundBank;
    }

    @Basic
    @Column(name = "refund_account", nullable = true, insertable = true, updatable = true, length = 50)
    public String getRefundAccount() {
        return refundAccount;
    }

    public void setRefundAccount(String refundAccount) {
        this.refundAccount = refundAccount;
    }

    @Basic
    @Column(name = "refund_person", nullable = true, insertable = true, updatable = true, length = 50)
    public String getRefundPerson() {
        return refundPerson;
    }

    public void setRefundPerson(String refundPerson) {
        this.refundPerson = refundPerson;
    }

    @Basic
    @Column(name = "refund_amount", nullable = true, insertable = true, updatable = true, precision = 2)
    public BigDecimal getRefundAmount() {
        return refundAmount;
    }

    public void setRefundAmount(BigDecimal refundAmount) {
        this.refundAmount = refundAmount;
    }

    @Basic
    @Column(name = "refund_reason", nullable = true, insertable = true, updatable = true, length = 200)
    public String getRefundReason() {
        return refundReason;
    }

    public void setRefundReason(String refundReason) {
        this.refundReason = refundReason;
    }

    @Basic
    @Column(name = "add_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "update_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "status", nullable = true, insertable = true, updatable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "memo", nullable = true, insertable = true, updatable = true, length = 200)
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TOrderRefundEntity entity = (TOrderRefundEntity) o;

        if (id != entity.id) return false;
        if (userId != null ? !userId.equals(entity.userId) : entity.userId != null) return false;
        if (orderId != null ? !orderId.equals(entity.orderId) : entity.orderId != null) return false;
        if (type != null ? !type.equals(entity.type) : entity.type != null) return false;
        if (refundBank != null ? !refundBank.equals(entity.refundBank) : entity.refundBank != null) return false;
        if (refundAccount != null ? !refundAccount.equals(entity.refundAccount) : entity.refundAccount != null)
            return false;
        if (refundPerson != null ? !refundPerson.equals(entity.refundPerson) : entity.refundPerson != null)
            return false;
        if (refundAmount != null ? !refundAmount.equals(entity.refundAmount) : entity.refundAmount != null)
            return false;
        if (refundReason != null ? !refundReason.equals(entity.refundReason) : entity.refundReason != null)
            return false;
        if (addTime != null ? !addTime.equals(entity.addTime) : entity.addTime != null) return false;
        if (updateTime != null ? !updateTime.equals(entity.updateTime) : entity.updateTime != null) return false;
        if (status != null ? !status.equals(entity.status) : entity.status != null) return false;
        if (memo != null ? !memo.equals(entity.memo) : entity.memo != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (orderId != null ? orderId.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (refundBank != null ? refundBank.hashCode() : 0);
        result = 31 * result + (refundAccount != null ? refundAccount.hashCode() : 0);
        result = 31 * result + (refundPerson != null ? refundPerson.hashCode() : 0);
        result = 31 * result + (refundAmount != null ? refundAmount.hashCode() : 0);
        result = 31 * result + (refundReason != null ? refundReason.hashCode() : 0);
        result = 31 * result + (addTime != null ? addTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        return result;
    }
}
